/* Turska Framework/UI library (Turs2)
 * Copyright 2003-2008 Jetro Lauha
 * All rights reserved.
 * Web: http://iki.fi/jetro/turska/
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of EITHER:
 *   (1) The GNU Lesser General Public License as published by the Free
 *       Software Foundation; either version 2.1 of the License, or (at
 *       your option) any later version. The text of the GNU Lesser
 *       General Public License is included with this library in the
 *       file LICENSE-LGPL.txt.
 *   (2) The BSD-style license that is included with this library in
 *       the file LICENSE-BSD.txt.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
 * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
 *
 * $Id: MainState.h 124 2009-06-05 05:28:16Z jlauha $
 * $Revision: 124 $
 */

#ifndef MAINSTATE_H_INCL
#define MAINSTATE_H_INCL


#include <vector>

using namespace std;


class MainState : public AppState
{
public:

    MainState();
    virtual ~MainState();

    // From AppState:

    virtual bool init();
    virtual void deinit();

    virtual bool update(UI32 time);
    virtual void render(SDL_Surface *screen);

    virtual void onActivate(UI32 time);
    virtual void onDeactivate() {}

    virtual bool onKeyDown(const SDL_keysym &event);
    virtual bool onKeyUp(const SDL_keysym &event);
    virtual bool onMouseDown(const SDL_MouseButtonEvent &event);
    virtual bool onMouseUp(const SDL_MouseButtonEvent &event);
    virtual bool onMouseMotion(const SDL_MouseMotionEvent &event);
    virtual bool onMouseWheel(I32 direction);
    virtual void onFocusLost(const SDL_ActiveEvent &event) {}
    virtual void onFocusGain(const SDL_ActiveEvent &event) {}

protected:

    enum IMAGE_ID
    {
        IMG_BUTTON = 0,
        IMG_BUTTON_HOT,
        IMG_BUTTON_ACTIVE,
        IMG_BUTTON_HOT_ACTIVE,
        IMG_HSLIDER,
        IMG_HSLIDER_HOT,
        IMG_HSLIDER_ACTIVE,
        IMG_HSLIDER_HOT_ACTIVE,
        IMG_HSLIDER_THUMB,
        IMG_HSLIDER_THUMB_HOT,
        IMG_HSLIDER_THUMB_ACTIVE,
        IMG_HSLIDER_THUMB_HOT_ACTIVE,
        IMG_VSLIDER,
        IMG_VSLIDER_HOT,
        IMG_VSLIDER_ACTIVE,
        IMG_VSLIDER_HOT_ACTIVE,
        IMG_VSLIDER_THUMB,
        IMG_VSLIDER_THUMB_HOT,
        IMG_VSLIDER_THUMB_ACTIVE,
        IMG_VSLIDER_THUMB_HOT_ACTIVE,
        IMG_TEXTFIELD,
        IMG_TEXTFIELD_HOT,
        IMG_TEXTFIELD_ACTIVE,
        IMG_TEXTFIELD_CARET,
        IMG_CHECKBOX,
        IMG_CHECKBOX_HOT,
        IMG_CHECKBOX_ACTIVE,
        IMG_CHECKBOX_HOT_ACTIVE,
        IMG_CHECKBOX_CHECK
    };

    IMGUI mIMGUI;
    IMGUIImageButtonStyle *mButtonStyle;
    IMGUIImageSliderStyle *mHorizSliderStyle;
    IMGUIImageSliderStyle *mVertSliderStyle;
    IMGUIImageTextFieldStyle *mTextFieldStyle;
    IMGUIImageButtonStyle *mCheckboxStyle;

    Font *mFont;
    vector<Image *> mImages;
    C8 *mLabelText;

    I32 mHorizSliderValue;
    F32 mVertSliderValue;
    bool mCheckboxValue;
};


#endif // !MAINSTATE_H_INCL
